<#include "../common/layout.ftl"/>
<@layout>
<div class="well">
	<span class="label label-success">添加员工</span>
	<form id="form1" class="well form-horizontal" action="save"  method="post" ENCTYPE="multipart/form-data">
	  <table  class="control-group">
	     <tr>
	        <td><label class="control-label" for="focusedInput">工号：</label></td>
	        <td><input class="input-xlarge focused" name="driver.job_number" id="job_number" type="text" ></td>
	        
	        <td><label class="control-label" for="focusedInput">密码：</label></td>
	        <td><input class="input-xlarge focused" name="driver.pwd" id="password" type="text" ></td>
	     </tr>
	     
	     
	      
	      <tr>
	        <td><label class="control-label" for="focusedInput">真实姓名：</label></td>
	        <td><input class="input-xlarge focused" name="driver.name" id="realname" type="text"  style="height: 26"  ></td>
	        
	        <td><label class="control-label" for="focusedInput">手机号码：</label></td>
	        <td><input class="input-xlarge focused" name="driver.phone" id="cellphone" type="text"  style="height: 26"  ></td>
	     </tr>
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">所属公司：</label></td>
	        <td>
	            <select id="license_num" name="driver.license_num">
              </select>
	        </td>
	        <td><label class="control-label" for="focusedInput">身份证号码：</label></td>
	        <td><input class="input-xlarge focused" name="driver.id_card" id="id_card" type="text"  style="height: 26"  ></td>
	     </tr>
	      <!--
	      <tr>
	        <td><label class="control-label" for="focusedInput">银行卡号：</label></td>
	        <td><input class="input-xlarge focused" name="driver.bank_no" id="id_card" type="text"  style="height: 26"  ></td>
	        
	        <td><label class="control-label" for="focusedInput">MAC地址：</label></td>
	        <td><input class="input-xlarge focused" name="driver.mac" id="mac" type="text"  style="height: 26"  ></td>
	     </tr-->
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">籍贯：</label></td>
	        <td><input class="input-xlarge focused" name="driver.hometown" id="hometown" type="text"  style="height: 26"  ></td>
	        
	        <td><label class="control-label" for="focusedInput">年龄：</label></td>
	        <td><input class="input-xlarge focused" name="driver.age" id="age"  type="text"  style="height: 26"  ></td>
	     </tr>
	     
	      <tr>
	        <td><label class="control-label" for="focusedInput">驾龄：</label></td>
	        <td><input class="input-xlarge focused" name="driver.driver_age" id="driver_age"  type="text"   ></td>
	        
	        <td><label class="control-label" for="focusedInput">驾照：</label></td>
	        <td>
	            <select id="sex" name="driver.driver_license">
                <option value="A1" selected>A1</option>
                <option value="A2">A2</option>
                <option value="A3">A3</option>
                <option value="B1">B1</option>
                <option value="B2">B2</option>
                <option value="C1">C1</option>
                <option value="C2">C2</option>
              </select>
	        </td>
	     </tr>
	     
	     <tr>
	        <td><label class="control-label" for="focusedInput">性别：</label></td>
	        <td>
	            <select id="sex" name="driver.sex">
                <option value="0" selected>男</option>
                <option value="1">女</option>
                <option value="2">未知</option>
              </select>
	        </td>
	        
	        <td><label class="control-label" for="focusedInput">头像：</label></td>
	        <td><input class="input-xlarge focused" name="driver.head"  type="file"  style="height: 26"  ></td>
	     </tr>
	     <tr>
	        <td><label class="control-label" for="focusedInput">军衔：</label></td>
	        <td>
	            <input class="input-xlarge focused" name="driver.level" value="" type="text" style="height: 26" >
	        </td>
	        <td><label class="control-label" for="focusedInput">积分：</label></td>
	        <td>
	           <input class="input-xlarge focused" name="driver.point" value="" type="text" style="height: 26" >
	        </td>
	     </tr>
	     <tr>
	        <td><label class="control-label" for="focusedInput">身份证图片：</label></td>
	        <td>
	            <input class="input-xlarge focused" name="driver.id_card_img" value="" type="file" style="height: 26" >
	        </td>
	        <td><label class="control-label" for="focusedInput">驾照图片：</label></td>
	        <td>
	           <input class="input-xlarge focused" name="driver.driver_license_img" value="" type="file" style="height: 26" >
	        </td>
	     </tr>
	     <tr>
			<td><label class="control-label" for="focusedInput">可接订单类型：</label></td>
			<td>
				<input name="post"   type="checkbox" value="0" >代驾员
	     		<input name="post"  type="checkbox" value="1"  >配送员
	     		<input name="post"   type="checkbox" value="2"  >保镖员
	     		<input name="post" type="checkbox" value="3"  >泊车员
			</td>
		</tr>
	  </table>
      
      <div class="form-actions" style="height: 10;float:right" >
        <button type="submit" class="btn btn-primary" onsubmit="save()">确 定</button>
        <button type="reset" class="btn">重 置</button>
        <button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
      </div>
  </form>
  </div>

<script>
	$(function() { 
	$.ajax({
	    type:'POST',
	    url:"listLicensenum",
	    dataType:"json",
	    success:function(result){
	    	$(result.record).each(function(){
	    		$("#license_num").append("<option value='"+$(this).attr('company')+"'>"+$(this).attr('companyname')+"</option>");
	    	});
	    },error:function(result){
	    	alert(result);
	    }
	});
     $("#form1").validity(function() {
         $("#job_number").require();
         $("#password").require();
         $("#realname").require();
         $("#cellphone").require().match("number");
         $("#license_num").require();
         $("#mac").require();
         $("#id_card").require();
         $("#hometown").require();
         $("#license_num").require();
         $("#age").require().match("number");
         $("#driver_age").require().match("number");
         $("#bank_no").require().match("number");
     });
 }); 
</script>
</@layout>